<div class="form-container">
<h2>Enter Your Information:</h2>
<div class="validation-errors" id="validationErrors" style="display:none;"></div>
<?php
	Includes::IncludeFile( Includes::$FORM );
	Includes::IncludeFile( Includes::$SPACER );

	echo( form_open(base_url() . 'index.php/walk/sponsor_walker/register_person_process/' . $urlKey .'/', array('id' => 'registrationForm') ) );

		Form::OpenFormItem('User Name*:', 260);
			echo( form_input(array('name'=>'userName','id'=>'userName','style'=>'width: 250px;')) );
		Form::CloseFormItem();
		Form::OpenFormItem('Password*:', 260);
			echo( form_password(array('name'=>'password','id'=>'password','style'=>'width: 250px;')) );
		Form::CloseFormItem();
		
		Spacer::Render(0, 15);
		
		Form::OpenFormItem('First Name*:', 260);
			echo( form_input(array('name'=>'firstName','id'=>'firstName','style'=>'width: 250px;')) );
		Form::CloseFormItem();
		Form::OpenFormItem('Last Name*:', 260);
			echo( form_input(array('name'=>'lastName','id'=>'lastName','style'=>'width: 250px;')) );
		Form::CloseFormItem();
		Form::OpenFormItem('Gender*:', 260);
			$genderOptions = array(''=>'Select','male'=>'Male','female'=>'Female');
			echo( form_dropdown('gender', $genderOptions, '', 'id="gender" style="width: 100px;" ') );
		Form::CloseFormItem();
		
		Spacer::Render(0, 15);
		
		Form::OpenFormItem('Primary Email*:', 260);
			echo( form_input(array('name'=>'primaryEmail','id'=>'primaryEmail','style'=>'width: 250px;')) );
		Form::CloseFormItem();
		Form::OpenFormItem('Home Phone Number*:', 260);
			echo( form_input(array('name'=>'homePhoneNumber','id'=>'homePhoneNumber','style'=>'width: 250px;')) );
		Form::CloseFormItem();
		Form::OpenFormItem('Mobile Phone Number:', 260);
			echo( form_input(array('name'=>'mobilePhoneNumber','id'=>'mobilePhoneNumber','style'=>'width: 250px;')) );
		Form::CloseFormItem();
		
		Spacer::Render(0, 15);
		
		Form::OpenFormItem('Home Address 1*:', 260);
			echo( form_input(array('name'=>'homeAddress1','id'=>'homeAddress1','style'=>'width: 250px;')) );
		Form::CloseFormItem();
		Form::OpenFormItem('Home Address 2:', 260);
			echo( form_input(array('name'=>'homeAddress2','id'=>'homeAddress2','style'=>'width: 250px;')) );
		Form::CloseFormItem();
		Form::OpenFormItem('City*:', 260);
			echo( form_input(array('name'=>'city','id'=>'city','style'=>'width: 250px;')) );
		Form::CloseFormItem();
		Form::OpenFormItem('State*:', 260);
			$stateOptions = array(''=>'Select','AL'=>'Alabama','AK'=>'Alaska','AZ'=>'Arizona','AR'=>'Arkansas','CA'=>'California','CO'=>'Colorado','CT'=>'Connecticut','DE'=>'Delaware','DC'=>'District of Columbia','FL'=>'Florida','GA'=>'Georgia','HI'=>'Hawaii','ID'=>'Idaho','IL'=>'Illinois','IN'=>'Indiana','IA'=>'Iowa','KS'=>'Kansas','KY'=>'Kentucky','LA'=>'Louisiana','ME'=>'Maine','MD'=>'Maryland','MA'=>'Massachusetts','MI'=>'Michigan','MN'=>'Minnesota','MS'=>'Mississippi','MO'=>'Missouri','MT'=>'Montana','NE'=>'Nebraska','NV'=>'Nevada','NH'=>'New Hampshire','NJ'=>'New Jersey','NM'=>'New Mexico','NY'=>'New York','NC'=>'North Carolina','ND'=>'North Dakota','OH'=>'Ohio','OK'=>'Oklahoma','OR'=>'Oregon','PA'=>'Pennsylvania','RI'=>'Rhode Island','SC'=>'South Carolina','SD'=>'South Dakota','TN'=>'Tennessee','TX'=>'Texas','UT'=>'Utah','VT'=>'Vermont','VA'=>'Virginia','WA'=>'Washington','WV'=>'West Virginia','WI'=>'Wisconsin','WY'=>'Wyoming');
			echo( form_dropdown('state', $stateOptions, '', 'id="state" style="width: 120px;" ') );
		Form::CloseFormItem();
		Form::OpenFormItem('Zip Code*:', 260);
			echo( form_input(array('name'=>'zipCode','id'=>'zipCode','style'=>'width: 100px;')) );
		Form::CloseFormItem();
		
	echo( form_close() );
?>
	
	<div class="form-button-container">
		<?php if($this->config->item('debug')){ ?><a href="javascript: populate();">Populate</a><?php } ?>
		<a href="javascript: validate();"><img src="<?php echo( base_url() );?>assets/images/buttons/next_off.gif" border="0" onmouseover="this.src = '<?php echo( base_url() );?>assets/images/buttons/next_over.gif';" onmousedown="this.src = '<?php echo( base_url() );?>assets/images/buttons/next_on.gif';" onmouseup="this.src = '<?php echo( base_url() );?>assets/images/buttons/next_off.gif';" onmouseout="this.src = '<?php echo( base_url() );?>assets/images/buttons/next_off.gif';" /></a>
	</div>

</div>

<script type="text/javascript">
	function validate()
	{
		new Ajax.Request(baseUrl + 'index.php/validation/walk_registration_validation/validate_step1/', 
		{
			method:'post',
			parameters: Form.serialize( $('registrationForm') ),
		  	onSuccess: function(response)
			{
				var result = response.responseText;
				
				if( result == 'VALIDATION_SUCCESS' )
				{
					$('registrationForm').submit();
				}
				else
				{
					$('validationErrors').innerHTML = result;
					$('validationErrors').show();
					Effect.ScrollTo('validationErrors', { duration:'0.2', offset:-20 });
				}
			},
			onFailure: function(response){var result = response.responseText; $('validationErrors').innerHTML = result;
					$('validationErrors').show();alert('failed') }
		});
	}
</script>

<?php if($this->config->item('debug')){ ?>
<script type="text/javascript">	
	function populate()
	{
		$('userName').value = 'john.doe';
		$('password').value = 'registerthis';
		$('firstName').value = 'John'
		$('lastName').value = 'Doe'
		$('gender').selectedIndex = 1;
		$('primaryEmail').value = 'john.doe@email.com';
		$('homePhoneNumber').value = '555-555-5555';
		$('mobilePhoneNumber').value = '';
		$('homeAddress1').value = '123 Sunset Blvd';
		$('homeAddress2').value = '';
		$('city').value = 'Lexington'
		$('state').selectedIndex = 22;
		$('zipCode').value = '02421';
	}
</script>
<?php } ?>